package com.gitee.feizns.explore.data_structure.linked_list.singly.palindrome;

/**
 * @author feizns
 * @since 2019/10/8
 */
public class ListNode {

    int val;
    ListNode next;
    ListNode(int x) { val = x; }

    public static ListNode create() {
        ListNode head = new ListNode(1);
        head.next = new ListNode(0);
        head.next.next = new ListNode(1);
//        head.next = new ListNode(2);
//        head.next.next = new ListNode(1);
//        head.next.next.next = new ListNode(1);
        return head;
    }

    public void print() {
        ListNode curt = this;
        while ( curt != null ) {
            System.out.print(curt.val + ",");
            curt = curt.next;
        }
        System.out.println();
    }

//    @Override
//    public String toString() {
//        return val + "," + next;
//    }

}
